package com.nursing.service;

import com.nursing.Dao.FamilyDao;
import com.nursing.bean.Family;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FamilyService {

    private final FamilyDao familyDao;

    public FamilyService(FamilyDao familyDao) {
        this.familyDao = familyDao;
    }


    public void add(Family family) {
        familyDao.insert(family);
    }

    public void delete(Integer id) {
        familyDao.delete(id);
    }

    public List<Family> getFamilyByElder(Integer elderId){
        return familyDao.getByElderId(elderId);
    }


}
